Having a solid R workflow is incredibly important for efficient and reproducible data analysis. It involves key practices like using R projects, leveraging the {here} package, and restarting the R session regularly. R projects provide a structured and isolated environment, ensuring project-specific settings and fostering collaboration. The {here} package simplifies file path management, boosting code portability across different systems, and saving you from the headaches of dealing with setwd(). Additionally, restarting the R session helps eliminate potential issues and ensures a clean workspace, reducing errors and allowing you to start fresh with your code execution.
Open the slides in a new tab here.
{here} package.csv file at https://raw.githubusercontent.com/louisahsmith/reproducible-epi-workshop-2023/main/data/nlsy.csvdata folder within your R project directory and move the nlsy.csv file there.here::here("data", "nlsy.csv") and see what file path prints out. Compare with your neighbor.read.csv(here::here("data", "nlsy.csv")) to make sure your can read in the file.{here} package documentation: